<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="path" value="${pageContext.request.contextPath}" />
<html>
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" type="text/css" href="${path}/plugin/jquery-easyUI/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${path}/plugin/jquery-easyUI/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="${path}/plugin/jquery-easyUI/demo.css">
    <script type="text/javascript" src="${path}/script/jquery.min.js"></script>
    <script type="text/javascript" src="${path}/plugin/jquery-easyUI/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${path}/script/dateFormat.js"></script>
</head>
<body>
<div class="loginForm">
    <div class="easyui-panel" title="登录" style="width:400PX;">
       <div style="padding:10px 60px 20px 60px">
           <form id="ff" class="easyui-form" method="post" data-options="novalidate:true">
               <table cellpadding="5">
                   <tr>
                       <td>用户名:</td>
                       <td><input class="easyui-textbox" type="text" name="name" data-options="required:true"></input></td>
                   </tr>
                   <tr>
                       <td>密码:</td>
                       <td><input class="easyui-textbox" type="password" name="password" data-options="required:true"></input></td>
                   </tr>
               </table>
           </form>
           <div style="text-align:center;padding:5px">
               <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">登录</a>
               <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">清空</a>
           </div>
       </div>
    </div>
</div>
    <script>
        function submitForm(){
            $('#ff').form('submit',{
                url:"/Lease/login.json",
                onSubmit:function(){
                    return $(this).form('enableValidation').form('validate');
                },
                success:function(data){
                var res=eval('('+data+')');
                    if(res.errorMsg){
                        alert(res.errorMsg);
                    }else{
                        location.href="/Lease/toOrder.htm";
                    }
                }
            });
        }
        function clearForm(){
            $('#ff').form('clear');
        }
    </script>
    <style>
        .loginForm{
            position:absolute;top:20%;left:35%;
        }
    </style>
</body>
</html>